package chapter5.section4;

//程序5-8：实例运算符instanceof使用方法的实例
public class TestInstanceof {
    public static void main(String[] args) {
        Account0509 account = new Account0509("001", "鲁宁", 1000);
        //判断account是否是Account的实例
        boolean res = account instanceof Account0509;
        if (res) {
            System.out.println("That is true");//如果是Account类型
        } else {
            System.out.println("That is false");//如果不是Account类型
        }
    }
}
